package com.project.mapper;

import com.project.entity.CarGoods;
import com.project.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

//订单操作
@Mapper
public interface CarGoodsMapper {

    //分页查询
    public List<CarGoods> findPage(@Param("pageIndex") Integer pageIndex,
                                   @Param("pageCount") Integer pageCount);


    List<CarGoods> findAll(@Param("userName") String userName);

    //添加购物车
    public void save(@Param("carGoods") CarGoods carGoods);

    //删除组件
    public void deleteById(@Param("id")Integer id);

    //更新数量
    public void updateCount(@Param("count")Integer count,@Param("id")Integer shoppingId);

    public void updateCountByOrderId(@Param("count")Integer count,@Param("id")Integer orderId,@Param("ownName")String ownName);


    CarGoods findOneByOrderId(@Param("orderId")Integer orderId,@Param("ownName")String ownName);

}
